/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package edu.clemson.cs.hamptos.adventure;

/**
 *
 * @author Nicks
 */
public class VerbDrop implements VerbStrategy {
    @Override
    public void doCommand(AdventureCommand c, AdventureEngine e, AdventureWindow w) {
        if ((c.getDirectObject() == null)||(c.getIndirectObject() != null))
        {
            w.println("Drop what again?");
            return;
        }
        try
        {
            e.removeFromPlayerInventory(c.getDirectObject());
            w.println("You dropped " + c.getDirectObject().getShortDescription());
        }
        catch (IllegalStateException ex)
        {
            w.println(ex.getMessage());
        }
    }
}